package zy2;

/**
 * 长方形
 */
public class Rectangle extends Graph{
    private int chang;
    private int kuan;

    public Rectangle(int chang, int kuan) {
        this.setChang(chang);
        this.setKuan(kuan);
    }

    public Rectangle() {
    }

    public int getChang() {
        return chang;
    }

    public void setChang(int chang) {
        this.chang = chang;
    }

    public int getKuan() {
        return kuan;
    }

    public void setKuan(int kuan) {
        this.kuan = kuan;
    }

    @Override
    public void perimeter() {
        double zc = 2*(getChang() + getKuan());
        System.out.println("长方形的周长:"+zc);
    }

    @Override
    public void area() {
        double mj = getChang() * getKuan();
        System.out.println("长方形的面积:"+mj);
    }
}
